{% extends "index.html" %}

{% load dajaxice_templatetags %}

{% block scripts %}
	{% dajaxice_js_import %}
	<script type="text/javascript" src="{{ STATIC_URL }}scripts/own/module_part_autocomplete.js"></script>
	<script type="text/javascript" charset="utf-8">
		$(document).ready(function() {
			autoComplete = new ModulePartAutoComplete($("#id_name"), '{{ module_term.module.id }}');
			$('.hint').tooltip({
				position: 'center right',
				effect: 'fade'
			});
		});
	</script>
{% endblock %}

{% block inline_navi %}
    <a href="{% url documents.views.index %}">
    	Dokumente
   	</a>
    &nbsp;>&nbsp;
    <a href="{% url documents.views.modulelist module_term.module.faculty.id %}">
    	{{ module_term.module.faculty }}
   	</a>
    &nbsp;>&nbsp;
    <a href="{% url documents.views.module module_term.id %}">
    	{{ module_term.module.name }}
    </a>
    &nbsp;>&nbsp;
    Neue Kategorie eintragen
{% endblock %}

{% block box_title %}
	Neue Kategorie anlegen
{% endblock %}
{% block box_content %}
	<p>
	    Hier kannst du für die Veranstaltung "{{ module_term.module.name }}" eine neue Kategorie anlegen.
	    Das sind Teile einer Veranstaltung wie z.B. Übung, Vorlesung, Klausur, Tutorium, ...
	</p>
	
	<div id="detail_table">
	    <h3>Kategorie</h3>
	    <form action="{% url documents.views.add_module_part module_term.id %}" enctype="multipart/form-data" method="post">
	        {% csrf_token %}
	        {{ form.non_field_errors }}
	        <table>
	            <!-- Name -->
	            <tr>
	                {% if form.name.errors %}
	                <th class="form_error"><label for="id_name">Freier Name erforderlich*:</label></th>
	                {% else %}
	                <th><label for="id_name">Name*:</label></th>
	                {% endif %}
	                <td>{{ form.name }}</td>
	                <td><div class="hint" title="Singular (z.B. Übung, Vorlesung, Tutorium)" /></td>
	            </tr>
	            <tr>
	                <td colspan="3" align="center" style="padding-top: 10px;">
	                    <input type="submit" value="Erstellen" />
	                </td>
	            </tr>
	        </table>
	    </form>
	</div>
{% endblock %}